﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using FriendsNearby.Services.NearbyNotifications;

namespace FriendsNearby.Services.Tests
{
    [TestFixture]
    public class NearbyNotificationMessageBuilderFixture
    {
        [Test]
        public void ShouldNotSendAMessageWhenSendMessageEvenIfIsEmptyIsFalse()
        {
            var notifications = new List<string>();
            var fragments = new List<string>();

            NearbyNotificationMessageBuilder.BuildNotificationMessage(notifications, (x) => fragments.Add(x), false);

            Assert.AreEqual(0, fragments.Count);
        }

        [Test]
        public void ShouldSendAMessageWhenSendMessageEvenIfIsEmptyIsTrue()
        {
            var notifications = new List<string>();
            var fragments = new List<string>();

            NearbyNotificationMessageBuilder.BuildNotificationMessage(notifications, (x) => fragments.Add(x), true);

            Assert.AreEqual(1, fragments.Count);
            Assert.AreEqual("No new nearby friends.", fragments[0]);
        }
    }
}
